//
//  CommentViewController.swift
//  douyinSwift
//
//  Created by 于波 on 2019/12/1.
//  Copyright © 2019 于波. All rights reserved.
//

import UIKit

class CommentViewController: UIViewController {

    @IBOutlet weak var CommentAreaView: UIView!
    
    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
    }
    
    @IBAction func closeBtnClick(_ sender: UIButton) {
        self.dismiss(animated: true, completion: nil)
    }
    
    @IBAction func tapClose(_ sender: UITapGestureRecognizer) {
        
        // 去掉下面评论view的手势 首先拿到要去掉的位置tapPoint
        let tapPoint = sender.location(in: CommentAreaView)
        
        // 如果点击位置 不位于评论view diss生效
        if !CommentAreaView.layer.contains(tapPoint) {
            self.dismiss(animated: true, completion: nil)
        }
        
    }
    
    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destination.
        // Pass the selected object to the new view controller.
    }
    */

}
